import axios from 'axios';
import config from '../config';

const api = axios.create({
    baseURL: config.API_BASE_URL
});

export const configurationApi = {
    getAll: () => api.get('/configurations'),
    getById: (id) => api.get(`/configurations/${id}`),
    create: (data) => api.post('/configurations', data),
    update: (id, data) => api.put(`/configurations/${id}`, data),
    delete: (id) => api.delete(`/configurations/${id}`),
    generate: (id) => api.post(`/configurations/${id}/generate`),
    exportToKafka: (id, kafkaConfig) => 
        api.post(`/configurations/${id}/export/kafka`, kafkaConfig)
};

export default api; 